package welsir.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import welsir.entity.dos.RotationChart;
import welsir.entity.dos.Setting;
import welsir.entity.vo.ResultMessage;
import welsir.mapper.RotationChartMapper;
import welsir.mapper.SettingMapper;
import welsir.service.IRotationChartService;
import welsir.service.ISettingService;
import welsir.service.IUserService;
import welsir.util.ResultUtil;

import java.util.List;

/**
 * @author Genius
 * @date 2023/03/07 16:37
 * 网站前端设置的一些api
 **/
@Api(value = "网站前端设置的api")
@RestController
@RequestMapping("/WebSetting")
public class WebSettingController {

    @Autowired
    private ISettingService settingService;

    @Autowired
    private IRotationChartService rotationChartService;

    @GetMapping("/getRotationChart")
    public ResultMessage<List<RotationChart>> getRotationChart(){
        return ResultUtil.data(this.rotationChartService.selectAll());
    }

    @GetMapping("/getSetting")
    public ResultMessage<Setting> getSetting(){
        return ResultUtil.data(settingService.selectOne());
    }
}
